Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cap negative values below 0 before quantifying to an unsigned int. #414

Merged
merged 1 commit into from
May 14, 2024

Conversation

hugobuddel
Copy link
Collaborator

Negative flux should be prevented, but casting it to an unsigned int will wrap around to MAXINT, which is even worse.

I'll merge this if the tests pass.

Negative flux should be prevented, but casting it to an unsigned
int will wrap around to MAXINT, which is even worse.
@hugobuddel hugobuddel requested a review from teutoburg May 14, 2024 21:16
Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 74.83%. Comparing base (8549c75) to head (42921c8).

Files Patch % Lines
scopesim/effects/electronic.py 55.55% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #414      +/-   ##
==========================================
- Coverage   74.84%   74.83%   -0.01%     
==========================================
  Files          56       56              
  Lines        7819     7824       +5     
==========================================
+ Hits         5852     5855       +3     
- Misses       1967     1969       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hugobuddel hugobuddel added bug Something isn't working enhancement New feature or request labels May 14, 2024
@hugobuddel
Copy link
Collaborator Author

Most tests pass, good enough. Coverage not, which is correct, but whatever

@hugobuddel hugobuddel merged commit 9911159 into main May 14, 2024
24 of 25 checks passed
@hugobuddel hugobuddel deleted the hb/preventnegativequantization branch May 14, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant